<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>校车轨迹</title>
	<link rel="stylesheet" href="/css/common2.css">
</head>

<body>

	<div id="vue-root">
		<div class="add">
			<a href="bus_site_item.html" style="color: white">添加线路</a>
		</div>
		<div class="refresh action-buttons" onclick="location.reload()">刷新</div>

		<div class="center">
			<div class="table">
				<table class="table_top">
					<thead>
						<tr>
							<th>
								<input type="checkbox" class="check-box" v-model="all">序号
							</th>
							<th>线路名称</th>
							<!-- <th>去程发车时间</th>
							<th>返程发车时间</th> -->
							<th>起点站</th>
							<th>终点站</th>
							<th>全程站点数</th>
							<th>全程耗时</th>
							<th>编辑/删除</th>
						</tr>
					</thead>
					<tbody id="list">
						<tr v-for="(route,index) in list" :key="route.id">
							<td>
								<input type="checkbox" class="check-box" v-model="route.checked">
								<span v-text="index+1"></span>
							</td>
							<td v-text="route.name"></td>
							<!-- <td v-text="route.goDepart"></td>
							<td v-text="route.comeDepart"></td> -->
							<td v-text="route.stops[0].name"></td>
							<td v-text="route.stops.slice(-1)[0].name"></td>
							<td><span v-text="route.stops.length"></span>站</td>
							<td><span v-text="eval(route.durations.join('+'))"></span>分钟</td>
							<td style="border-left: none; margin-top: 1px;">
								<div class="option">
									<div class="edit-icon option-icon" style="position: absolute; left: 20%; top: 30%;">
										<a :href="'bus_site_item.html?id='+route.id">
											<img class="img" src="../image/edit.png" height="20" width="20"
												onmouseover="this.src='../image/edit_light.png'"
												onmouseout="this.src='../image/edit.png'">
										</a>
									</div>
									<div class="delete-icon option-icon" style="right: 20%; top:30%;position: absolute;"
										@click="del([route.id])">
										<img class="img" src="../image/delete.png" height="20" width="20"
											onmouseover="this.src='../image/delete_light.png'"
											onmouseout="this.src='../image/delete.png'">
									</div>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
		</ul>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>
	<script>

		var app = new Vue(merge({
			data: {
				urls: {
					del: '/pc/route/del',
					list: '/pc/route/list/' + top_params().id
				}
			}
		}));
	</script>

</body>

</html>